﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Data;

namespace AbetEvaluation.Business
{
    public partial class Rubrics : Component
    {
        public Rubrics()
        {
            InitializeComponent();
        }

        public Rubrics(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }

        public static DataTable GetRubrics(Guid outcomeID)
        {
            Data.DataSet1TableAdapters.abet_RubricsTableAdapter adapter = new Data.DataSet1TableAdapters.abet_RubricsTableAdapter();
            Data.DataSet1.abet_RubricsDataTable table = adapter.GetRubrics(outcomeID);
            return table;
        }

        public static int InsertRubric(Rubric r)
        {
            Data.DataSet1TableAdapters.abet_RubricsTableAdapter adapter = new Data.DataSet1TableAdapters.abet_RubricsTableAdapter();
            int result = adapter.InsertRubric(r.OutcomeID, r.CategoryName, r.LowerBound, r.UpperBound);
            return result;
        }

        public static int UpdateRubric(Rubric r)
        {
            Data.DataSet1TableAdapters.abet_RubricsTableAdapter adapter = new Data.DataSet1TableAdapters.abet_RubricsTableAdapter();
            int result = adapter.UpdateRubric(r.CategoryName, r.LowerBound, r.UpperBound, r.RubricID);
            return result;
        }

        public static int DeleteRubric(Rubric r)
        {
            Data.DataSet1TableAdapters.abet_RubricsTableAdapter adapter = new Data.DataSet1TableAdapters.abet_RubricsTableAdapter();
            int result = adapter.DeleteRubric(r.RubricID);
            return result;
        }

        public static int DeleteRubrics(Guid outcomeID)
        {
            Data.DataSet1TableAdapters.abet_RubricsTableAdapter adapter = new Data.DataSet1TableAdapters.abet_RubricsTableAdapter();
            int result = adapter.DeleteRubrics(outcomeID);
            return result;
        }
    }
}
